package com.todo.strategy.pipeline.infrastructure.mapper;

import com.todo.strategy.pipeline.infrastructure.entity.po.PipelineRecordPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/2/28 20:54
 * @description
 */
@Mapper
public interface PipelineRecordMapper {
    /**
     * 新增管道记录
     *
     * @param pipelineRecordPO
     * @return
     */
    boolean insertPipelineRecord(PipelineRecordPO pipelineRecordPO);

    /**
     * 根据唯一键查询管道记录
     *
     * @param uniKey
     * @param actionType
     * @return
     */
    PipelineRecordPO queryPipelineRecordByUniKey(String uniKey, Integer actionType);

    /**
     * 更新管道记录
     *
     * @param pipelineRecordPO
     * @return
     */
    boolean updatePipelineRecord(PipelineRecordPO pipelineRecordPO);

    /**
     * 根据时间范围查询管道记录
     *
     * @param actionType
     * @param status
     * @param startTime
     * @param endTime
     * @return
     */
    List<PipelineRecordPO> queryPipelineRecordByTimeRange(@Param("actionType") Integer actionType, @Param("status") Integer status, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
}
